/* 主样式文件 */
:root {
  --primary-color: #4361ee;
  --secondary-color: #3f37c9;
  --success-color: #4caf50;
  --info-color: #2196f3;
  --warning-color: #ff9800;
  --danger-color: #f44336;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
  --gray-color: #6c757d;
  --white-color: #ffffff;
  --background-color: #f5f7fa;
  --border-color: #e9ecef;
  --shadow-color: rgba(0, 0, 0, 0.05);
}

body {
  font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
  background-color: var(--background-color);
  margin: 0;
  padding: 0;
  color: #333;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* 布局 */
.container-fluid {
  width: 100%;
  padding-right: 1rem;
  padding-left: 1rem;
  margin-right: auto;
  margin-left: auto;
}

.container {
  width: 100%;
  max-width: 1200px;
  padding-right: 1rem;
  padding-left: 1rem;
  margin-right: auto;
  margin-left: auto;
}

/* 导航栏 */
.navbar {
  background-color: var(--white-color);
  box-shadow: 0 2px 5px var(--shadow-color);
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  color: var(--primary-color);
  font-size: 1.5rem;
  font-weight: bold;
  text-decoration: none;
}

.navbar-nav {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item {
  margin-left: 1rem;
}

.nav-link {
  color: var(--dark-color);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: 0.25rem;
  transition: all 0.2s;
}

.nav-link:hover {
  background-color: var(--light-color);
}

.nav-link.active {
  color: var(--primary-color);
  font-weight: 500;
}

/* 侧边栏 */
.sidebar {
  width: 250px;
  background-color: var(--white-color);
  box-shadow: 0 0 10px var(--shadow-color);
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  padding-top: 3.5rem;
  overflow-x: hidden;
  overflow-y: auto;
}

.sidebar-sticky {
  padding-top: 1rem;
}

.sidebar .nav-link {
  color: var(--dark-color);
  font-weight: 500;
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  margin-bottom: 0.25rem;
}

.sidebar .nav-link:hover {
  background-color: var(--light-color);
}

.sidebar .nav-link.active {
  color: var(--white-color);
  background-color: var(--primary-color);
}

.sidebar .nav-link i {
  margin-right: 0.5rem;
  width: 24px;
  text-align: center;
}

/* 主内容区 */
.main {
  margin-left: 250px;
  padding: 1.5rem;
  flex: 1;
}

/* 卡片 */
.card {
  background-color: var(--white-color);
  border-radius: 0.5rem;
  box-shadow: 0 0 10px var(--shadow-color);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--white-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--dark-color);
}

.card-body {
  padding: 1.5rem;
}

/* 表格 */
.table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.table th,
.table td {
  padding: 0.75rem;
  vertical-align: middle;
  border-top: 1px solid var(--border-color);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table thead th {
  vertical-align: middle;
  border-bottom: 2px solid var(--border-color);
  background-color: var(--light-color);
  color: var(--gray-color);
  font-weight: 500;
  position: sticky;
  top: 0;
  z-index: 10;
}

.table tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

.table tbody tr:nth-child(even) {
  background-color: rgba(0, 0, 0, 0.01);
}

/* 表格中的特定列样式 */
.table th:first-child, 
.table td:first-child {
  text-align: center;
}

/* 状态标签居中 */
.table td .badge {
  display: inline-block;
  min-width: 60px;
  text-align: center;
}

/* 表格中的操作按钮 */
.table .actions {
  white-space: nowrap;
  text-align: center;
}

.table .actions .btn {
  margin: 0 2px;
  min-width: 40px;
}

/* 表单 */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-control {
  display: block;
  width: 100%;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #495057;
  background-color: var(--white-color);
  background-clip: padding-box;
  border: 1px solid var(--border-color);
  border-radius: 0.25rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
  border-color: var(--primary-color);
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(67, 97, 238, 0.25);
}

/* 按钮 */
.btn {
  display: inline-block;
  font-weight: 400;
  color: #212529;
  text-align: center;
  vertical-align: middle;
  cursor: pointer;
  background-color: transparent;
  border: 1px solid transparent;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  border-radius: 0.25rem;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out,
    border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.btn-primary {
  color: var(--white-color);
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
}

.btn-secondary {
  color: var(--white-color);
  background-color: var(--gray-color);
  border-color: var(--gray-color);
}

.btn-success {
  color: var(--white-color);
  background-color: var(--success-color);
  border-color: var(--success-color);
}

.btn-danger {
  color: var(--white-color);
  background-color: var(--danger-color);
  border-color: var(--danger-color);
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  border-radius: 0.2rem;
}

/* 徽章 */
.badge {
  display: inline-block;
  padding: 0.25em 0.5em;
  font-size: 75%;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.25rem;
}

.badge-primary {
  color: var(--white-color);
  background-color: var(--primary-color);
}

.badge-secondary {
  color: var(--white-color);
  background-color: var(--gray-color);
}

.badge-success {
  color: var(--white-color);
  background-color: var(--success-color);
}

.badge-warning {
  color: var(--white-color);
  background-color: var(--warning-color);
}

.badge-danger {
  color: var(--white-color);
  background-color: var(--danger-color);
}

/* 弹性布局工具 */
.d-flex {
  display: flex !important;
}

.justify-content-between {
  justify-content: space-between !important;
}

.align-items-center {
  align-items: center !important;
}

/* 间距工具 */
.mt-3 {
  margin-top: 1rem !important;
}

.mb-3 {
  margin-bottom: 1rem !important;
}

.ml-2 {
  margin-left: 0.5rem !important;
}

.mr-2 {
  margin-right: 0.5rem !important;
}

.p-3 {
  padding: 1rem !important;
}

/* 登录页面样式 */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: var(--background-color);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background-color: var(--white-color);
  border-radius: 0.5rem;
  box-shadow: 0 0 20px var(--shadow-color);
  overflow: hidden;
}

.login-header {
  padding: 1.5rem;
  text-align: center;
  background-color: var(--primary-color);
  color: var(--white-color);
}

.login-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 500;
}

.login-body {
  padding: 1.5rem;
}

.login-footer {
  padding: 1rem;
  text-align: center;
  border-top: 1px solid var(--border-color);
  background-color: var(--light-color);
}

/* 下拉菜单样式 */
.dropdown {
  position: relative;
}

.dropdown-toggle::after {
  display: inline-block;
  margin-left: 0.5em;
  vertical-align: middle;
  content: "";
  border-top: 0.3em solid;
  border-right: 0.3em solid transparent;
  border-bottom: 0;
  border-left: 0.3em solid transparent;
}

.dropdown-menu {
  position: absolute;
  left: 0;
  z-index: 1000;
  display: none;
  min-width: 10rem;
  padding: 0.5rem 0;
  margin: 0;
  font-size: 1rem;
  color: #212529;
  text-align: left;
  list-style: none;
  background-color: var(--white-color);
  background-clip: padding-box;
  border: 1px solid var(--border-color);
  border-radius: 0.25rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.dropdown-menu.show {
  display: block;
}

.sidebar .dropdown-menu {
  position: static;
  float: none;
  margin-top: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding-left: 2rem;
  width: 100%;
}

.sidebar .dropdown-item {
  display: block;
  width: 100%;
  padding: 0.5rem 1rem;
  clear: both;
  font-weight: 400;
  color: var(--dark-color);
  text-align: inherit;
  text-decoration: none;
  white-space: nowrap;
  background-color: transparent;
  border: 0;
}

.sidebar .dropdown-item:hover,
.sidebar .dropdown-item:focus {
  color: var(--primary-color);
  background-color: var(--light-color);
}

.sidebar .dropdown-item.active {
  color: var(--white-color);
  background-color: var(--primary-color);
} 